<!-- 膜品应用 -->
<template>
	<view class="film_product">
		<slot></slot>
		<!-- 横向滚动框 -->
		<scroll-view class='film_list' scroll-x>
			<view @click="toMore(item.type)" class="film_item" v-for="(item,index) in filmList">
				<view class="film_item_bo">
					<img :src="item.cover" :alt="itemTitle(item.type)" />
					<view class="film_item_bottom">
						<view style="font-family: PingFang SC, PingFang SC;font-weight: bold;font-size: 28rpx;color: #000000;">
							{{ itemTitle(item.type) }}
						</view>	
						<view class="film_function">
							<view>
								<img src="/static/home/view.png" alt="浏览数" />
								{{ item.view }}
							</view>
							<view>
								<img src="/static/home/good.png" alt="点赞数" />
								{{ item.likes }}
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props:{
			filmList:{
				type: Array,
				default: []
			}
		},
		methods: {
			itemTitle(type){
				switch(type){
					case 1: return '改色膜';
					case 2: return '隐形车衣';
					case 3: return '隔热膜';
					case 4: return 'TPU改色';
					case 5: return '店端VIS';
				}
			},
			toMore(type){
				uni.navigateTo({
					url: '/pages/product/new-product?type='+type
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.film_product{
	display: flex;
	flex-direction: column;
	margin-bottom: 42rpx;
}
.film_list{
	height: 530rpx;
	width: 100%;
	white-space: nowrap;
	.film_item{
		width: 320rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		display: inline-block;
		margin-right: 16rpx;
		.film_item_bo{
			display: flex;
			flex-direction: column;
			img{
				height: 426rpx;
				width: 320rpx;
				border-radius: 8rpx 8rpx 0rpx 0rpx;
			}
			.film_item_bottom{
				background-color: #FFFFFF;
				height: 104rpx;
				border-radius: 0rpx 0rpx 8rpx 8rpx;
				font-family: DIN, DIN;
				font-weight: 400;
				font-size: 22rpx;
				color: #595959;
				padding: 14rpx 16rpx;
				.film_function{
					display: flex;
					margin-top: 14rpx;
					view{
						margin-right: 32rpx;
						display: flex;
						align-items: center;
						img{
							width: 24rpx;
							height: 24rpx;
							margin-right: 4rpx;
						}
					}
				}
			}
		}
	}
}
</style>
